﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using CustomDrawnFileDialog;

namespace ImageRecognition2
{
    /// <summary>
    /// This is used to be able to change the dialog implementation between 
    /// CustomDialog and default .net dialog
    /// </summary>
    public class OpenFileDialogWrapper : IFileDialog
    {
        /// <summary>
        /// 
        /// </summary>
        private OpenFileDialog m_OpenFileDialog = new OpenFileDialog();

        /// <summary>
        /// Default Constructor
        /// </summary>
        public OpenFileDialogWrapper()
        {

        }

        #region IFileDialog Member

        /// <summary>
        /// Return filter for displaying filenames and extensions
        /// </summary>
        public string Filter
        {
            get { return m_OpenFileDialog.Filter; }
            set { m_OpenFileDialog.Filter = value; }
        }

        /// <summary>
        /// Show this to the caller
        /// </summary>
        /// <returns></returns>
        public DialogResult ShowDialog()
        {
            return m_OpenFileDialog.ShowDialog();
        }

        /// <summary>
        /// Set or get FileName
        /// </summary>
        public string FileName
        {
            get { return m_OpenFileDialog.FileName; }
            set { m_OpenFileDialog.FileName = value; }
        }

        #endregion
    }
}
